<html><head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Joueur" rel="Chapter" href="Joueur.html">
<link title="Joueur2" rel="Chapter" href="Joueur2.html">
<link title="Joueur3" rel="Chapter" href="Joueur3.html">
<link title="Joueur4" rel="Chapter" href="Joueur4.html"><title>Joueur.pose_question</title>
</head>
<body>
<code class="code"><span class="keyword">let</span>&nbsp;<span class="keyword">rec</span>&nbsp;pose_question&nbsp;objet&nbsp;((id_info,contenu):information)=<br>
<span class="keyword">match</span>&nbsp;id_info&nbsp;<span class="keyword">with</span><br>
<span class="keywordsign">|</span>0<span class="keywordsign">-&gt;</span>&nbsp;(0,[|objet<span class="keywordsign">#</span>get_nbjoueurs;objet<span class="keywordsign">#</span>get_id|])<br>
<span class="keywordsign">|</span>1<span class="keywordsign">-&gt;</span>&nbsp;(1,&nbsp;[|contenu.(0)&nbsp;;&nbsp;perso2int&nbsp;(objet<span class="keywordsign">#</span>get_whoswho&nbsp;contenu.(0)&nbsp;)|])<br>
<span class="keywordsign">|</span>2<span class="keywordsign">-&gt;</span>&nbsp;(2,[|<span class="constructor">Random</span>.int&nbsp;objet<span class="keywordsign">#</span>get_nbjoueurs|])<br>
<span class="keywordsign">|</span>3<span class="keywordsign">-&gt;</span><span class="keyword">if</span>&nbsp;objet<span class="keywordsign">#</span>who_am_i&nbsp;=&nbsp;<span class="constructor">Loup</span>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;(2,[|<span class="constructor">Random</span>.int&nbsp;objet<span class="keywordsign">#</span>get_nbjoueurs|])&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;failwith&nbsp;(<span class="constructor">Printf</span>.sprintf&nbsp;<span class="string">"%i&nbsp;dit:&nbsp;ERREUR&nbsp;je&nbsp;ne&nbsp;suis&nbsp;pas&nbsp;un&nbsp;loup&nbsp;garou,&nbsp;une&nbsp;telle&nbsp;erreur&nbsp;n'aurait&nbsp;pas&nbsp;du&nbsp;arriver\n&nbsp;verifier&nbsp;la&nbsp;fonction&nbsp;passé&nbsp;en&nbsp;argument&nbsp;à&nbsp;la&nbsp;procedure&nbsp;de&nbsp;vote&nbsp;"</span>&nbsp;objet<span class="keywordsign">#</span>get_id)<br>
<span class="keywordsign">|</span>4<span class="keywordsign">-&gt;</span><span class="keyword">if</span>&nbsp;objet<span class="keywordsign">#</span>get_whoswho&nbsp;(objet<span class="keywordsign">#</span>get_id)&nbsp;=&nbsp;<span class="constructor">Voyante</span>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;&nbsp;(2,[|(<span class="constructor">Random</span>.int&nbsp;objet<span class="keywordsign">#</span>get_nbjoueurs)|])&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;failwith&nbsp;(<span class="constructor">Printf</span>.sprintf&nbsp;<span class="string">"%i&nbsp;dit:&nbsp;ERREUR&nbsp;je&nbsp;ne&nbsp;suis&nbsp;pas&nbsp;la&nbsp;voyante,&nbsp;une&nbsp;telle&nbsp;erreur&nbsp;n'aurait&nbsp;pas&nbsp;du&nbsp;arriver\n&nbsp;verifier&nbsp;la&nbsp;fonction&nbsp;passé&nbsp;en&nbsp;argument&nbsp;à&nbsp;la&nbsp;procedure&nbsp;de&nbsp;vote&nbsp;"</span>&nbsp;objet<span class="keywordsign">#</span>get_id)<br>
<span class="keywordsign">|</span>5<span class="keywordsign">-&gt;</span>(5,[|<span class="constructor">Random</span>.int&nbsp;2;<span class="constructor">Random</span>.int&nbsp;objet<span class="keywordsign">#</span>get_nbjoueurs;<span class="constructor">Random</span>.int&nbsp;2|])<br>
<span class="keywordsign">|</span>_<span class="keywordsign">-&gt;</span>&nbsp;((-1),[||])</code></body></html>